# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJob do
  @moduledoc """
  NotebookExecutionJob represents an instance of a notebook execution.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when this NotebookExecutionJob was created.
  *   `customEnvironmentSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJobCustomEnvironmentSpec.t`, *default:* `nil`) - The custom compute configuration for an execution job.
  *   `dataformRepositorySource` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJobDataformRepositorySource.t`, *default:* `nil`) - The Dataform Repository pointing to a single file notebook repository.
  *   `directNotebookSource` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJobDirectNotebookSource.t`, *default:* `nil`) - The contents of an input notebook file.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The display name of the NotebookExecutionJob. The name can be up to 128 characters long and can consist of any UTF-8 characters.
  *   `encryptionSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1EncryptionSpec.t`, *default:* `nil`) - Customer-managed encryption key spec for the notebook execution job. This field is auto-populated if the NotebookRuntimeTemplate has an encryption spec.
  *   `executionTimeout` (*type:* `String.t`, *default:* `nil`) - Max running time of the execution job in seconds (default 86400s / 24 hrs).
  *   `executionUser` (*type:* `String.t`, *default:* `nil`) - The user email to run the execution as. Only supported by Colab runtimes.
  *   `gcsNotebookSource` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJobGcsNotebookSource.t`, *default:* `nil`) - The Cloud Storage url pointing to the ipynb file. Format: `gs://bucket/notebook_file.ipynb`
  *   `gcsOutputUri` (*type:* `String.t`, *default:* `nil`) - The Cloud Storage location to upload the result to. Format: `gs://bucket-name`
  *   `jobState` (*type:* `String.t`, *default:* `nil`) - Output only. The state of the NotebookExecutionJob.
  *   `kernelName` (*type:* `String.t`, *default:* `nil`) - The name of the kernel to use during notebook execution. If unset, the default kernel is used.
  *   `labels` (*type:* `map()`, *default:* `nil`) - The labels with user-defined metadata to organize NotebookExecutionJobs. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of this NotebookExecutionJob. Format: `projects/{project_id}/locations/{location}/notebookExecutionJobs/{job_id}`
  *   `notebookRuntimeTemplateResourceName` (*type:* `String.t`, *default:* `nil`) - The NotebookRuntimeTemplate to source compute configuration from.
  *   `scheduleResourceName` (*type:* `String.t`, *default:* `nil`) - The Schedule resource name if this job is triggered by one. Format: `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
  *   `serviceAccount` (*type:* `String.t`, *default:* `nil`) - The service account to run the execution as.
  *   `status` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleRpcStatus.t`, *default:* `nil`) - Output only. Populated when the NotebookExecutionJob is completed. When there is an error during notebook execution, the error details are populated.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when this NotebookExecutionJob was most recently updated.
  *   `workbenchRuntime` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJobWorkbenchRuntime.t`, *default:* `nil`) - The Workbench runtime configuration to use for the notebook execution.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :customEnvironmentSpec =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJobCustomEnvironmentSpec.t()
            | nil,
          :dataformRepositorySource =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJobDataformRepositorySource.t()
            | nil,
          :directNotebookSource =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJobDirectNotebookSource.t()
            | nil,
          :displayName => String.t() | nil,
          :encryptionSpec =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1EncryptionSpec.t() | nil,
          :executionTimeout => String.t() | nil,
          :executionUser => String.t() | nil,
          :gcsNotebookSource =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJobGcsNotebookSource.t()
            | nil,
          :gcsOutputUri => String.t() | nil,
          :jobState => String.t() | nil,
          :kernelName => String.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :notebookRuntimeTemplateResourceName => String.t() | nil,
          :scheduleResourceName => String.t() | nil,
          :serviceAccount => String.t() | nil,
          :status => GoogleApi.AIPlatform.V1.Model.GoogleRpcStatus.t() | nil,
          :updateTime => DateTime.t() | nil,
          :workbenchRuntime =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJobWorkbenchRuntime.t()
            | nil
        }

  field(:createTime, as: DateTime)

  field(:customEnvironmentSpec,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJobCustomEnvironmentSpec
  )

  field(:dataformRepositorySource,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJobDataformRepositorySource
  )

  field(:directNotebookSource,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJobDirectNotebookSource
  )

  field(:displayName)
  field(:encryptionSpec, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1EncryptionSpec)
  field(:executionTimeout)
  field(:executionUser)

  field(:gcsNotebookSource,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJobGcsNotebookSource
  )

  field(:gcsOutputUri)
  field(:jobState)
  field(:kernelName)
  field(:labels, type: :map)
  field(:name)
  field(:notebookRuntimeTemplateResourceName)
  field(:scheduleResourceName)
  field(:serviceAccount)
  field(:status, as: GoogleApi.AIPlatform.V1.Model.GoogleRpcStatus)
  field(:updateTime, as: DateTime)

  field(:workbenchRuntime,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJobWorkbenchRuntime
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJob do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJob.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NotebookExecutionJob do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
